﻿#region License statement
// NJamb, a specification and delta-specification DSL
// Copyright (c) 2010-2011, Mark Knell
// Published under the MIT License; all other rights reserved
#endregion

#region using...
using NJamb.NUnit;
using NJamb.Parser.SpecificationBuilders.SubjectHas.Extensions;
using NJamb.Parser.SpecificationBuilders.SubjectIs.Extensions;
using NJamb.Parser.SubjectBuilders;
using NUnit.Framework;
using Stile.Testing.SampleTypes;
#endregion

namespace NJamb.DemoCode
{
	public class SyntaxShowcaseFixture : ExperimentOn<Sample>
	{
		[Test]
		public void Foo()
		{
			Specify.For(() => TestSubject).That(x => x.Int).Is.GreaterThanOrEqualTo(1);
			//Specify.For(()=> TestSubject).That(x=>x.String).Is.GreaterThanOrEqualTo(1);
			Specify.For(() => TestSubject).That(x => x.String).Is.StringEndingWith("z");
			Specify.For(() => TestSubject).ThatTheCollection(x => x.IntCollection).Has.Some.ItemsSatisfying(x => x == 2);
			Specify.For(() => TestSubject).ThatTheSequence(x => x.IntCollection).Has.MinOf(2);
			Specify.For(() => TestSubject).That(x => x.String).Is.NullOrWhitespace();
			Specify.For(() => TestSubject).That(x => x.NullableInt).Is.Not.Null();

			Assert.Fail("backstop");
		}

		protected override Sample TestSubjectFactory()
		{
			return new Sample();
		}
	}
}
